package com.young.dubbo.protocol.dubbo;


import com.young.dubbo.framework.Invocation;
import com.young.dubbo.framework.Protocol;
import com.young.dubbo.framework.URL;
import com.young.dubbo.register.ZookeeperRegister;

import java.util.List;

public class DubboProtocol implements Protocol {
    @Override
    public void start(String host, int port,String interfaceName) {
        new NettyServer().start(host, port,interfaceName);
    }

    @Override
    public String send(String host, int port, Invocation invocation) {
        return new NettyClient<>().send(host,port,invocation);
    }

    @Override
    public List<URL> getUrls(String interfaceName) {
        return ZookeeperRegister.get(interfaceName);
    }
}
